package chapter10;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2018-03-21 下午4:04
 */
public class ArrayTest {
    private static final Logger LOGGER = LoggerFactory.getLogger(ArrayTest.class);

    public static void main(String[] args) {
        int[] dataA = new int[]{1, 2, 3};
        int[] dataB = new int[]{1, 2, 3};
        LOGGER.info("dataA == dataB:{}", dataA == dataB);
        LOGGER.info("dataA equals dataB:{}", Arrays.equals(dataA, dataB));

        Book[] books = new Book[]{
                new Book("test1", 123.2),
                new Book("test2", 13.2),
                new Book("test3", 193.2),
                new Book("test4", 23.2),
                new Book("test5", 83.2)
        };

        Arrays.sort(books);
        for (Book book : books) {
            LOGGER.info(book.toString());
        }
    }
}
